import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '招标人',
    align:"center",
    dataIndex: 'zbr'
   },
   {
    title: '项目名称',
    align:"center",
    dataIndex: 'projectName'
   },
   {
    title: '项目编号',
    align:"center",
    dataIndex: 'projectCode'
   },
   {
    title: '项目类型',
    align:"center",
    dataIndex: 'xmlxdm_dictText'
   },
   {
    title: '受理时间',
    align:"center",
    dataIndex: 'slsj',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
   },
   {
    title: '招标方式(1公开招标)',
    align:"center",
    dataIndex: 'zbfs'
   },
   {
    title: '进场状态',
    align:"center",
    dataIndex: 'entryStatus_dictText'
   },
];

//子表表格配置
export const gcProjectEntrySectionColumns: JVxeColumn[] = [
    {
      title: '标段名称',
      key: 'sectionName',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
        validateRules: [
          { required: true, message: '${title}不能为空' },
        ],
    },
    {
      title: '标段编号',
      key: 'sectionCode',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
        validateRules: [
          { required: true, message: '${title}不能为空' },
        ],
    },
    {
      title: '价款形式',
      key: 'jkxs',
      type: JVxeTypes.select,
      options:[],
      dictCode:"sys_price_type",
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '招标类别',
      key: 'zblb',
      type: JVxeTypes.select,
      options:[],
      dictCode:"sys_project_section_type",
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '合同估算价',
      key: 'htgsj',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '标段分类代码',
      key: 'sectionType',
      type: JVxeTypes.select,
      options:[],
      dictCode:"sys_project_section_category",
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '显示序号',
      key: 'sortNum',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '计划开工日期',
      key: 'jhkgrq',
      type: JVxeTypes.date,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '工程规模',
      key: 'gcgm',
      type: JVxeTypes.date,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '工程概况',
      key: 'gcgk',
      type: JVxeTypes.date,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '要求投标人资质等级',
      key: 'yqtbrzzdj',
      type: JVxeTypes.date,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '版本号',
      key: 'version',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]

// 高级查询数据
export const superQuerySchema = {
  zbr: {title: '招标人',order: 0,view: 'text', type: 'string',},
  projectName: {title: '项目名称',order: 7,view: 'text', type: 'string',},
  projectCode: {title: '项目编号',order: 8,view: 'text', type: 'string',},
  xmlxdm: {title: '项目类型代码(字典：sys_project_type)',order: 11,view: 'list', type: 'string',dictCode: 'sys_project_type',},
  slsj: {title: '受理时间',order: 36,view: 'date', type: 'string',},
  zbfs: {title: '招标方式(1公开招标)',order: 37,view: 'text', type: 'string',},
  entryStatus: {title: '进场状态(0-草稿 1-受理中 2-已受理)',order: 50,view: 'list', type: 'string',dictCode: 'gc_project_entry_status',},
  //子表高级查询
  gcProjectEntrySection: {
    title: '项目标段信息',
    view: 'table',
    fields: {
        sectionName: {title: '标段名称',order: 0,view: 'text', type: 'string',},
        sectionCode: {title: '标段编号',order: 1,view: 'text', type: 'string',},
        jkxs: {title: '价款形式(字典：sys_price_type)',order: 2,view: 'list', type: 'string',dictCode: 'sys_price_type',},
        zblb: {title: '招标类别(字典：sys_project_section_type)',order: 3,view: 'list', type: 'string',dictCode: 'sys_project_section_type',},
        htgsj: {title: '合同估算价',order: 4,view: 'text', type: 'string',},
        sectionType: {title: '标段分类代码(字典：sys_project_section_category)',order: 5,view: 'list', type: 'string',dictCode: 'sys_project_section_category',},
        sortNum: {title: '显示序号',order: 6,view: 'text', type: 'string',},
        jhkgrq: {title: '计划开工日期',order: 7,view: 'date', type: 'string',},
        gcgm: {title: '工程规模',order: 8,view: 'date', type: 'string',},
        gcgk: {title: '工程概况',order: 9,view: 'date', type: 'string',},
        yqtbrzzdj: {title: '要求投标人资质等级',order: 10,view: 'date', type: 'string',},
        version: {title: '版本号',order: 11,view: 'number', type: 'number',},
    }
  },
};
